package com.lucy.nepu.module.thinktank.rule;


import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class IsGradeValidator implements ConstraintValidator<IsGrade, Object> {

    @Override
    public void initialize(IsGrade constraintAnnotation) {
        ConstraintValidator.super.initialize(constraintAnnotation);
    }

    @Override
    public boolean isValid(Object o, ConstraintValidatorContext constraintValidatorContext) {
        String grade = o.toString();
        if (grade.equals("一") || grade.equals("二") || grade.equals("三")){
            return true;
        }
        return false;
    }
}

